function main(params) {
    const self = this;

    let treeSelectId = params.data.columns.id;
    // 区域类型（-1 全国 0 省 1 市 2 区县 3 街道 4 社区）
    let type = parseInt(params.data.columns.type)

    // countryId、provinceId、cityId、districtId、streetId、communityId
    const fields = ['countryId', 'provinceId', 'cityId', 'districtId', 'streetId', 'community'];
    let result = {
        countryId: null,
        provinceId: null,
        cityId: null,
        districtId: null,
        streetId: null,
        community: null,
        unitId: null
    };

    if (treeSelectId.endsWith('region')) {
        const index = type + 1;
        let regionId = parseInt(treeSelectId.replace(/[^0-9]/g, ''))
        if (index >= 0 && index < fields.length) {
            result[fields[index]] = regionId;
        }
    } else {
        result[unitId] = parseInt(treeSelectId.replace(/[^0-9]/g, ''))
    }

    let pageTableList = self.$$("page_widget_list_hluais");
    if (pageTableList.dataEngine && pageTableList.dataEngine.state) {
        // 给列表组件设置参数，参数名meter_id为要过滤列表中的列名，后面为参数值，取自树节点参数
        pageTableList.$children[0].$$setExtraParams({
            countryId: result.countryId,
            provinceId: result.provinceId,
            cityId: result.cityId,
            districtId: result.districtId,
            streetId: result.streetId,
            communityId: result.community,
            unitId: result.unitId
        })
        // 找到列表部件中的表格组件元素
        let tableComp = pageTableList.dataEngine.state.getElement("table_8q94sy");
        if (tableComp) {
            //执行列表刷新
            tableComp.$$refreshData();
        }
    }

}


function main() {
    // 获取页面树实例
    const pageTreeEle = this.$$("page_tree_5620bo");
    // 获取树渲染实例
    const treeRenderEle = pageTreeEle.$$getRenderElement();
    const treePanelEle = treeRenderEle.$$getTreeElement();
    const id = treePanelEle.$$getRootNode()[0].id;
    // const firstNode = treePanelEle.$$getFirstNode();
    treePanelEle.$$clickNode({ key: id });
}
